package com.example.plan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 订单表
 * @TableName order
 */
@TableName(value ="order")
@Data
public class Order implements Serializable {
    /**
     * 订单ID
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long order_id;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long user_id;

    /**
     * 分配的无人机ID
     */
    @TableField(value = "drone_id")
    private Long drone_id;

    /**
     * 收货地址ID
     */
    @TableField(value = "address_id")
    private Long address_id;

    /**
     * 订单编号
     */
    @TableField(value = "order_sn")
    private String order_sn;

    /**
     * 货物重量（kg）
     */
    @TableField(value = "goods_weight")
    private BigDecimal goods_weight;

    /**
     * 紧急程度
     */
    @TableField(value = "urgency")
    private Object urgency;

    /**
     * 运输场景模式
     */
    @TableField(value = "scene_mode")
    private Object scene_mode;

    /**
     * 紧急救援模式下的医院信息（名称、地址、联系方式）
     */
    @TableField(value = "hospital_info")
    private Object hospital_info;

    /**
     * 目的地坐标
     */
    @TableField(value = "destination_coords")
    private Integer destination_coords;

    /**
     * 订单状态
     */
    @TableField(value = "status")
    private Object status;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private Date created_at;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at")
    private Date updated_at;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getOrder_id() == null ? other.getOrder_id() == null : this.getOrder_id().equals(other.getOrder_id()))
            && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id()))
            && (this.getDrone_id() == null ? other.getDrone_id() == null : this.getDrone_id().equals(other.getDrone_id()))
            && (this.getAddress_id() == null ? other.getAddress_id() == null : this.getAddress_id().equals(other.getAddress_id()))
            && (this.getOrder_sn() == null ? other.getOrder_sn() == null : this.getOrder_sn().equals(other.getOrder_sn()))
            && (this.getGoods_weight() == null ? other.getGoods_weight() == null : this.getGoods_weight().equals(other.getGoods_weight()))
            && (this.getUrgency() == null ? other.getUrgency() == null : this.getUrgency().equals(other.getUrgency()))
            && (this.getScene_mode() == null ? other.getScene_mode() == null : this.getScene_mode().equals(other.getScene_mode()))
            && (this.getHospital_info() == null ? other.getHospital_info() == null : this.getHospital_info().equals(other.getHospital_info()))
            && (this.getDestination_coords() == null ? other.getDestination_coords() == null : this.getDestination_coords().equals(other.getDestination_coords()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreated_at() == null ? other.getCreated_at() == null : this.getCreated_at().equals(other.getCreated_at()))
            && (this.getUpdated_at() == null ? other.getUpdated_at() == null : this.getUpdated_at().equals(other.getUpdated_at()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrder_id() == null) ? 0 : getOrder_id().hashCode());
        result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode());
        result = prime * result + ((getDrone_id() == null) ? 0 : getDrone_id().hashCode());
        result = prime * result + ((getAddress_id() == null) ? 0 : getAddress_id().hashCode());
        result = prime * result + ((getOrder_sn() == null) ? 0 : getOrder_sn().hashCode());
        result = prime * result + ((getGoods_weight() == null) ? 0 : getGoods_weight().hashCode());
        result = prime * result + ((getUrgency() == null) ? 0 : getUrgency().hashCode());
        result = prime * result + ((getScene_mode() == null) ? 0 : getScene_mode().hashCode());
        result = prime * result + ((getHospital_info() == null) ? 0 : getHospital_info().hashCode());
        result = prime * result + ((getDestination_coords() == null) ? 0 : getDestination_coords().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreated_at() == null) ? 0 : getCreated_at().hashCode());
        result = prime * result + ((getUpdated_at() == null) ? 0 : getUpdated_at().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", order_id=").append(order_id);
        sb.append(", user_id=").append(user_id);
        sb.append(", drone_id=").append(drone_id);
        sb.append(", address_id=").append(address_id);
        sb.append(", order_sn=").append(order_sn);
        sb.append(", goods_weight=").append(goods_weight);
        sb.append(", urgency=").append(urgency);
        sb.append(", scene_mode=").append(scene_mode);
        sb.append(", hospital_info=").append(hospital_info);
        sb.append(", destination_coords=").append(destination_coords);
        sb.append(", status=").append(status);
        sb.append(", created_at=").append(created_at);
        sb.append(", updated_at=").append(updated_at);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}